package com.lbyl.adapter.topnews;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.lbyl.fragment.pager.TopNewsFragmentPager;

import java.util.ArrayList;

/**
 * TopNews中五个标签的适配器
 *
 * @author libin996@outlook.com
 */

public class TopNewsViewPagerAdapter extends FragmentPagerAdapter {


    private static final String TAG = "TopNewsViewPagerAdapter";
    private ArrayList<TopNewsFragmentPager> fragmentList;


    public TopNewsViewPagerAdapter(FragmentManager fm, ArrayList<TopNewsFragmentPager> fragmentList) {
        super(fm);
        this.fragmentList = fragmentList;
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }


    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }



    @Override
    public CharSequence getPageTitle(int position) {
        return fragmentList.get(position).getTitle();
    }
}
